package ar.com.ford.it.fullEconomics.facade;

import java.sql.Timestamp;
import java.util.Collection;
import ar.com.ford.it.fullEconomics.exception.FullEconomicsException;
import ar.com.ford.it.fullEconomics.logic.EconomicValueLogic;
import ar.com.ford.it.fullEconomics.persistence.dto.Teese03Econvalue;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesg01Plant;
import ar.com.ford.it.fullEconomics.wslx.FullEconomicsWslxUser;

public class EconomicValueFacade {
    /**
     *  Find Alll Economic Index Value  
     * @param plant
     * @return
     * @throws FullEconomicsException
     */
    public Collection economicValueFindAll(Teesg01Plant plant) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.findAllEconomicValue(plant);
    }
    
    /**
     * Create Eco Value
     */
    public void economicValueCreate(Teese03Econvalue ecoV, FullEconomicsWslxUser user) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        logic.createEconomicValue(ecoV, user);
    }
    
    public Collection economicValuePeriods(Teesg01Plant plant) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.periodEconomicValue(plant);
    }
    
    
    public boolean economicValueDelete(Teese03Econvalue ecoV, FullEconomicsWslxUser user) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.deleteEconomicValue(ecoV);
    }

    public void economicValueUpdate(Teese03Econvalue ecoV, FullEconomicsWslxUser user) throws FullEconomicsException {
        EconomicValueLogic logic = new EconomicValueLogic();
        logic.updateEconomicValue(ecoV, user);
        
    }

    public boolean economicValueIsRepeat(Teese03Econvalue ecoV) {
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.economicValueIsRepeat(ecoV); 
    }
    
    public Collection getEconomicValuesMaxLessDate(Teese03Econvalue ecoV,Timestamp periodSelec) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.getEconomicValuesMaxLessDate(ecoV,periodSelec);
    }

    public Collection getEconomicValuesMaxPeriodDate(Teese03Econvalue ecoV) {
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.getEconomicValuesMaxPeriodDate(ecoV);
    }
    
    public void approEconomicValue (Teese03Econvalue ecoV, FullEconomicsWslxUser user) throws FullEconomicsException{
        EconomicValueLogic logic = new EconomicValueLogic();
        logic.approveEcoV(ecoV, user);
    }

    
    public boolean validateAppro(Teese03Econvalue ecoV, FullEconomicsWslxUser user) throws FullEconomicsException {
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.ecoVApprovedValidate(ecoV, user);
    }
    
    public boolean isRegisterEconomic(Teese03Econvalue ecoV) throws FullEconomicsException {
        EconomicValueLogic logic = new EconomicValueLogic();
        return logic.ecoVRegistrationValidate(ecoV);
    }
    
}
